<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="Beans.OrderForm" import="Beans.OpenRoom" import="DaosImpl.OrderDaoImpl" %>
<html>
	<%
		String path = request.getContextPath();
		String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
	%>
  <head>
    <meta charset="UTF-8">
    <title>订单信息</title>
    <link href=<%=basePath+"/stylesheets/reserveInfo.css"%> type="text/css" rel="stylesheet">
    <style>
        html,body{
            height: 100%;
            margin:0;
            padding: 0;
        }
    </style>

  </head>
  
  <body>
  	<%
  		String msg = (String)session.getAttribute("msg");
  		session.removeAttribute("msg");
  		if(msg!=null&&msg!=""){
  			%>
  			<script type="text/javascript">
  				var msg = '<%=msg%>';
  				alert(msg);
  			</script>
  			<%
  		}
  	 %>
    <div id="themeText">酒店订单信息查看</div>
	<div id="showRoomFrame">
		<div id="manageInfo">
        	<button  class="importBtn" onclick="window.location.href = 'http://localhost:8080/HotelSystem/Servlets/ExportInfoServlet?judge=1'">导出信息</button>
        	<button class="exportBtn" onclick="window.location.href = 'http://localhost:8080/HotelSystem/Servlets/ImportInfoServlet?judge=1'">导入信息</button>
    	</div>
    	<table cellpadding="0" cellspacing="0">
	        <thead>
	            <tr>
	                <th>订单编号</th>
	                <th>身份证</th>
	                <th>顾客姓名</th>
	                <th>房号</th>
	                <th>支付金额</th>
	                <th>租期</th>
	                <th>离开日期</th>
	            </tr>
	        </thead>
	        <tbody>
	            <%
	            	OrderDaoImpl orderDao = new OrderDaoImpl();
	            	ArrayList<OrderForm> orderList = new ArrayList<OrderForm>();
	            	orderList = orderDao.queryViewOrder();
	            	for(int i = 0;i<orderList.size();i++){
	            		%>
	            		<tr>
				                <td width="10%"><%=orderList.get(i).getOfID() %></td>
				                <td width="20%"><%=orderList.get(i).getIdCard() %></td>
				                <td width="10%"><%=orderList.get(i).getName() %></td>
				                <td width="10%"><%=orderList.get(i).getRoomid() %></td>
				                <td width="15%"><%=orderList.get(i).getOfPayMoney() %></td>
				                <td width="20%"><%=orderList.get(i).getOfInDate() %>至<%=orderList.get(i).getOfWantOutDate() %></td>
				                <td width="15%"><%=orderList.get(i).getOfOutDate() %></td>
	            		</tr>
	            		<%
	            	}
	             %>
	        </tbody>
    </table>
  </body>
</html>
